﻿using System;
using System.Runtime.Serialization;

namespace Antix.Mail.Smtp.Impostor
{
    [Serializable]
    public class InvalidMailAddressException : Exception
    {
        public InvalidMailAddressException(string address)
            : base($"{address} not recognised as a valid e-mail address")
        {
            Address = address;
        }

        protected InvalidMailAddressException(
            SerializationInfo info,
            StreamingContext context)
            : base(info, context)
        {
        }

        public string Address { get; private set; }
    }
}